/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.genius.demo;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class GridViewAdapter extends BaseAdapter {
	private int imageViewId;
	Context mContext;
	LayoutInflater mLayoutInflater;
	MenuItemData mMenuItemData;
	private int menu_itemId;
	private int textViewId;

	public GridViewAdapter(Context paramContext,
			MenuItemData paramMenuItemData, int paramInt1, int paramInt2,
			int paramInt3) {
		this.mContext = paramContext;
		this.mLayoutInflater = LayoutInflater.from(paramContext);
		this.mMenuItemData = paramMenuItemData;
		this.imageViewId = paramInt2;
		this.textViewId = paramInt3;
		this.menu_itemId = paramInt1;
	}

	public int getCount() {
		return this.mMenuItemData.getCount();
	}

	public Object getItem(int paramInt) {
		return Integer.valueOf(paramInt);
	}

	public long getItemId(int paramInt) {
		return paramInt;
	}

	public View getView(int paramInt, View paramView, ViewGroup paramViewGroup) {
		if (paramView == null)
			paramView = this.mLayoutInflater.inflate(this.menu_itemId, null);
		ImageView localImageView = (ImageView) paramView
				.findViewById(this.imageViewId);
		localImageView.setBackgroundDrawable(this.mMenuItemData
				.getDrawable(paramInt));
		localImageView.setImageDrawable(this.mMenuItemData
				.getDrawable(paramInt));
		TextView localTextView = (TextView) paramView
				.findViewById(this.textViewId);
		localTextView.setText(this.mMenuItemData.getTitle(paramInt));
		localTextView.setTextColor(-1);
		return paramView;
	}

	public void refreshData(MenuItemData paramMenuItemData) {
		this.mMenuItemData = paramMenuItemData;
		notifyDataSetChanged();
	}
}